import fetch from '@/utils/network/fetch'

const getUsers = (objc = {}) => {
    fetch('/api/administrator', objc)
}

const addUser = (objc = {}) => {
    fetch('/api/administrator', objc)
}

const editUser = (objc = {}) => {
    fetch(`/api/administrator/${objc.data.employeeId}`, objc)
}

const removeUser = (objc = {}) => {
    fetch('/api/administrator/deletion', objc)
}

const getOrganizations = (objc = {}) => {
    fetch('/api/organization', objc)
}

const resetUserPassword = (data, objc) => {
    data &&
        fetch('/api/user', {
            ...objc,
            method: 'put',
            data
        })
}

export default {
    getUsers,
    addUser,
    editUser,
    removeUser,
    resetUserPassword,
    getOrganizations
}
